package cn.com.blueInfo.bpm.number.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 流水号重置周期
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum NumberSerialResetCycle implements BaseEnum<String> {

    /** 流水号重置周期-不重置 */
    NONE("NONE", "不重置"),
    /** 流水号重置周期-每年重置 */
    YEAR("YEAR", "每年重置"),
    /** 流水号重置周期-每月重置 */
    MONTH("MONTH", "每月重置"),
    /** 流水号重置周期-每天重置 */
    DAY("DAY", "每天重置");

    @EnumValue
    private final String code;

    @JsonValue
    private final String desc;

    public static NumberSerialResetCycle getByCode(String code) {
        return BaseEnum.getByCode(NumberSerialResetCycle.class, code);
    }

    @JsonCreator
    public static NumberSerialResetCycle getByName(String name) {
        return BaseEnum.getByName(name, NumberSerialResetCycle.class);
    }

}
